package com.yy.effects
{
	import flash.filters.BevelFilter;
	import flash.filters.BitmapFilterQuality;
	import flash.filters.BitmapFilterType;
	import flash.filters.ColorMatrixFilter;
	import flash.filters.ConvolutionFilter;
	import flash.filters.GlowFilter;
	import flash.filters.GradientBevelFilter;
	import flash.geom.ColorTransform;

	/**
	 * 常用的滤镜效果
	 * @author YY
	 * 
	 */
	public class CommonEffects
	{
		public function CommonEffects()
		{
		}
		
		//【泛用】一般按钮置为不可用时滤镜
		public static const BUTTON_DISABLE_FILTER:Array = [new ColorMatrixFilter([0.33, 0.33, 0.33, 0, 0,
			0.33, 0.33, 0.33, 0, 0,
			0.33, 0.33, 0.33, 0, 0,
			0, 0, 0, 1, 0])];
		
		//【泛用】置为不可用时灰色滤镜，色彩更暗
		public static const DARKER_DISABLE_FILTER:Array = [new ColorMatrixFilter([0.15, 0.15, 0.15, 0, 0,
			0.15, 0.15, 0.15, 0, 0,
			0.15, 0.15, 0.15, 0, 0,
			0, 0, 0, 1, 0])];
		
		//【泛用】一般小号按钮文字标签描边滤镜
		public static const SMALL_BUTTON_LABEL_FILTER:Array = 
			[ new GlowFilter(0x000000,1,3,3,4,BitmapFilterQuality.LOW,false,false)];
		
		//【泛用】一般文字标签描边滤镜
		public static const LABEL_FILTER:Array = 
			[ new GlowFilter(0x000000,1,2,2,8,BitmapFilterQuality.LOW,false,false)];
		
		//【泛用】小资源图标描边滤镜
		public static const SMALL_RESOURCE_ICON_FILTER:Array = 
			[new GlowFilter(0x000000,1,1,1,2,BitmapFilterQuality.HIGH,false,false)];
		
		//【泛用】模态窗口背景效果滤镜
		public static const MODAL_WINDOW_BACKGROUND_FILTER:Array =
			[new ColorMatrixFilter([
				1, 0, 0, 0, -100, 
				0, 1, 0, 0, -100, 
				0, 0, 1, 0, -100, 
				0, 0, 0, 1, 0
			])];
		
		//【泛用】 灰度滤镜
		public static const GRAY_FILTER:Array = 
			[new ColorMatrixFilter([ 
				0.3, 0.3, 0.3, 0, 0,
				0.3, 0.3, 0.3, 0, 0,
				0.3, 0.3, 0.3, 0, 0, 
				0, 0, 0, 1, 0		
			])];
		
		//【泛用】灰度滤镜，更暗
		public static const DARKER_GRAY_FILTER:Array = 
			[new ColorMatrixFilter([ 
				0.2, 0.2, 0.2, 0, 0, 
				0.2, 0.2, 0.2, 0, 0, 
				0.2, 0.2, 0.2, 0, 0, 
				0, 0, 0, 1, 0		
			])];
		
		//【泛用】色彩亮化效果
		public static const LIGHTER_COLOR_FILTER:Array = 
			[new ColorMatrixFilter([ 
				1.3, 0, 0, 0, 0, 
				0, 1.3, 0, 0, 0, 
				0, 0, 1.3, 0, 0, 
				0, 0, 0, 1, 0		
			])];
		
		//【泛用】色彩暗化效果
		public static const DARKER_COLOR_FILTER:Array = 
			[new ColorMatrixFilter([ 
				1, 0, 0, 0, -68.85, 
				0, 1, 0, 0, -68.85, 
				0, 0, 1, 0, -68.85, 
				0, 0, 0, 1, 0		
			])];
		
		//【泛用】立体化按钮效果
		public static const BEVEL_FILTER:Array = [
			new GradientBevelFilter(1,225,[0xcFcFcF, 0xcFcFcF, 0x000000, 0x000000],[0.8,0,0,0.8],[0,10,245,255]
				,3,3,3,BitmapFilterQuality.LOW,BitmapFilterType.INNER)
		];	
		
		//【泛用】箭头按钮鼠标移上发光效果
		public static const ARROWBUTTON_HOVER_FILTER:Array = [new GlowFilter(0xffff00)];	
		
		//【泛用】城内建筑鼠标移上发光效果
		public static const BUILDING_HOVER_FILTER:Array = [new GlowFilter(0xFFFF00,1,16,16,2,BitmapFilterQuality.LOW,false,false)];
		
		//【泛用】大地图野地鼠标移上发光效果
		public static const MAP_EMPTY_HOVER_FILTER:Array = [new GlowFilter(0xFFFF00,1,16,16,2,BitmapFilterQuality.LOW,true,true)];
		
		//【泛用】大地图建筑鼠标移上发光效果
		public static const MAP_BUILD_HOVER_FILTER:Array = [new GlowFilter(0xFFFF00,1,16,16,2,BitmapFilterQuality.LOW,false,true)];
		
		
		//【泛用】副本据点鼠标移上发光效果
		public static const INSTANCE_BUILDING_HOVER_FILTER:Array = [new GlowFilter(0xFF0000,1,16,16,2,BitmapFilterQuality.LOW,false,true)];
		
		//【泛用】城内建筑建造中
		public static const BUILDING_FILTER:Array = [new GlowFilter(16711680, 0.3, 100, 100, 2, 1, true)];
		
		//【泛用】datagrid行背景鼠标移上发光效果
		public static const TABLE_ROW_HOVER_FILTER:Array = 
			[new ColorMatrixFilter([1.0485245,-0.0868395,-0.011685,0,50.675,-0.0439755,1.0056605,-0.011685,0,50.675,-0.0439755,-0.0868395,1.080815,0,50.675,0,0,0,1,0])]
		
		//【泛用】datagrid行背景被选中效果
		public static const TABLE_ROW_SELECTED_FILTER:Array = [new GlowFilter(0x66FF00,0.8,16,16,2,BitmapFilterQuality.LOW,true,false)];
		
		//【泛用】一般控件置为不可用后滤镜
		public static const COMPONENT_DISABLE_FILTER:Array = 
			[new ConvolutionFilter(3,3,
				[-2, -1, 0, 
					-1, 1, 1, 
					0, 1, 2],
				1,0,true,true,0x66FF00,1), 
				new ColorMatrixFilter([
					1, 0, 0, 0, -153, 
					0, 1, 0, 0, -153, 
					0, 0, 1, 0, -153, 
					0, 0, 0, 1, 0
				])];
		
		//【泛用】鼠标经过图标时滤镜
		public static const ICON_HOVER_FILTER:Array = [new GlowFilter(0x80806E,1,5,5,2,BitmapFilterQuality.HIGH,true,false)];
		
		//【泛用】老照片效果
		public static const SEPHIA_FILTER:Array = 
			[new ColorMatrixFilter([
				0.5, 0.5, 0, 0, 44, 
				0.3, 0.7, 0, 0, 22, 
				0.6, 0.4, 0, 0, 0, 
				0, 0, 0, 1, 0
			])];	
		
		
		
		//移动到按钮上面的效果
		public static const MOVE_BUT_COLOR:Array =[new ColorMatrixFilter([ 1.2,0,0,0,0,
			0,1.2,0,0,0,
			0,0,1.2,0,0,
			0,0,0,1.2,0 ])];
		
		
		//【专用】黑色石头按钮文字标签滤镜
		public static const STONEBUTTON_UP_LABEL_FILTER:Array = 
			[ new GlowFilter(0x000000,1,6,6,4,BitmapFilterQuality.LOW,false,false)];
		
		//【专用】黑色石头按钮鼠标经过时文字标签滤镜
		public static const STONEBUTTON_OVER_LABEL_FILTER:Array = 
			[
				new GlowFilter(0xFFFF5F,1,8,8,1,BitmapFilterQuality.LOW,false,false),
				new GlowFilter(0x000000,1,1,1,1,BitmapFilterQuality.LOW,false,false),			
				new GlowFilter(0xFFFFCF,1,8,8,3,BitmapFilterQuality.LOW,true,false)];
		
		//【专用】白色石头按钮文字标签滤镜
		public static const WHITE_STONEBUTTON_UP_LABEL_FILTER:Array = 
			[ new GlowFilter(0xffffff,1,3,3,16,BitmapFilterQuality.LOW,false,false)];
		
		//【专用】白色石头按钮鼠标经过时文字标签滤镜
		public static const WHITE_STONEBUTTON_OVER_LABEL_FILTER:Array = 
			[ new GlowFilter(0x000000,1,3,3,16,BitmapFilterQuality.LOW,false,false)];
		
		//【专用】白色石头按钮被选择后滤镜效果
		public static const WHITE_STONEBUTTON_SELEACTED_FILTER:Array = 
			[new ColorMatrixFilter([ 
				1, 0, 0, 0, -30, 
				0, 1, 0, 0, -30, 
				0, 0, 1, 0, -30, 
				0, 0, 0, 1, 0		
			])]; 
	}
}